home *** CD-ROM | disk | FTP | other *** search
- /*=======================================================*/
- /* TVINT15I.C */
- /* low-level functions for TV software interrupts */
- /* requires MASM or A86 to recompile */
- /* */
- /* (c) Copyright 1988 Ralf Brown All Rights Reserved */
- /* May be freely copied for noncommercial use, so long */
- /* as this copyright notice remains intact, and any */
- /* changes are marked in the comment blocks preceding */
- /* functions. */
- /*=======================================================*/
-
- #pragma inline
-
- #include "tvapi.h"
-
- /*======================================================*/
- /* _TVinterrupt_handler low-level function which */
- /* passes control to user */
- /* interruption routine */
- /* Ralf Brown 4/8/88 */
- /*======================================================*/
-
- void far pascal _TVinterrupt_handler(void)
- {
- void far (*handler)(void) ;
-
- asm push es
- asm push ds
- asm push di
- asm push si
- asm push dx
- asm push cx
- asm push bx
- asm push ax
- /* now that we've saved all the registers, call the real handler */
- asm mov handler,di /* build return address, and then jump to it */
- asm mov handler+2,es
- asm mov ax,DGROUP
- asm mov ds,ax
- (*handler)() ;
- /* restore the registers and return */
- asm pop ax
- asm pop bx
- asm pop cx
- asm pop dx
- asm pop si
- asm pop di
- asm pop ds
- asm pop es
- }
-
- /*======================================================*/
- /* _restore_DS get back TurboC's data segment */
- /* Ralf Brown 8/9/88 */
- /*======================================================*/
-
- WORD _restore_DS(void)
- {
- #ifdef __TINY__
- asm mov ax,cs
- asm mov ds,ax
- #endif
- #if !defined(__HUGE__) && !defined(__TINY__)
- asm mov ax,DGROUP
- asm mov ds,ax
- #else
- asm mov ax,ds /* huge model sets DS on every function entry */
- #endif
- return _AX ;
- }
-
- /* End of TVINT15I.C */
-